import threading

# 线程之间，内存是共享的
# 因此可以修改全局变量
name = 'lucky'
a = [1, 2]


def run():
    global name
    global a
    name = 'hhh'
    a.append(3)
    print(name)
    print(a)


if __name__ == '__main__':
    thread1 = threading.Thread(target=run)
    thread1.start()
    thread1.join()
    print(name)
    print(a)
